home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / biz / dopus / DOpus414JRsrc.lha / DirectoryOpus4 / Library / dopuslib.a < prev    next >
Text File  |  2000-04-01  |  11KB  |  572 lines

  1. ; Directory Opus 4
  2. ; Original GPL release version 4.12
  3. ; Copyright 1993-2000 Jonathan Potter
  4. ; This program is free software; you can redistribute it and/or
  5. ; modify it under the terms of the GNU General Public License
  6. ; as published by the Free Software Foundation; either version 2
  7. ; of the License, or (at your option) any later version.
  8. ; This program is distributed in the hope that it will be useful,
  9. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. ; GNU General Public License for more details.
  12. ; You should have received a copy of the GNU General Public License
  13. ; along with this program; if not, write to the Free Software
  14. ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  15. ; All users of Directory Opus 4 (including versions distributed
  16. ; under the GPL) are entitled to upgrade to the latest version of
  17. ; Directory Opus version 5 at a reduced price. Please see
  18. ; http://www.gpsoft.com.au for more information.
  19. ;
  20. ; The release of Directory Opus 4 under the GPL in NO WAY affects
  21. ; the existing commercial status of Directory Opus 5.
  22.  
  23.  
  24.     section LibBases,data
  25.  
  26.     XDEF _SysBase
  27.     XDEF _DOpusBase
  28.     XDEF _IntuitionBase
  29.     XDEF _GfxBase
  30.     XDEF _DOSBase
  31.     XDEF _LayersBase
  32.     XDEF ___MathIeeeSingBasBase
  33.  
  34. _SysBase:
  35.     dc.l 0
  36. _DOpusBase:
  37.     dc.l 0
  38. _IntuitionBase:
  39.     dc.l 0
  40. _GfxBase:
  41.     dc.l 0
  42. _DOSBase:
  43.     dc.l 0
  44. _LayersBase:
  45.     dc.l 0
  46. ___MathIeeeSingBasBase:
  47.     dc.l 0
  48.  
  49.     SECTION .text
  50.  
  51.     INCLUDE "exec/types.i"
  52.     INCLUDE "exec/initializers.i"
  53.     INCLUDE "exec/libraries.i"
  54.     INCLUDE "exec/lists.i"
  55.     INCLUDE "exec/alerts.i"
  56.     INCLUDE "exec/resident.i"
  57.     INCLUDE "exec/ports.i"
  58.     INCLUDE "exec/io.i"
  59.     INCLUDE "libraries/dos.i"
  60.     INCLUDE "graphics/rastport.i"
  61.  
  62.     INCLUDE "asmsupp.i"
  63.     INCLUDE "dopusbase.i"
  64.  
  65. * Functions.a
  66.  
  67.     XREF endcode
  68.     XREF GetWBScreen
  69.     XREF Seed
  70.     XREF Random
  71.     XREF StrToUpper
  72.     XREF StrToLower
  73.     XREF DisableGadget
  74.     XREF EnableGadget
  75.     XREF GhostGadget
  76.     XREF _SwapMem
  77.     XREF _LSprintf
  78.     XREF LSprintf
  79.     XREF LCreateExtIO
  80.     XREF LCreatePort
  81.     XREF LDeleteExtIO
  82.     XREF LDeletePort
  83.     XREF LToUpper
  84.     XREF LToLower
  85.     XREF LStrCat
  86.     XREF LStrnCat
  87.     XREF LStrCpy
  88.     XREF LStrnCpy
  89.     XREF LStrCmpI
  90.     XREF LStrnCmpI
  91.     XREF LStrCmp
  92.     XREF LStrnCmp
  93.  
  94. * Functions2.a
  95.  
  96.     XREF BtoCStr
  97.     XREF ActivateStrGad
  98.     XREF RefreshStrGad
  99.  
  100. * Graphics.a
  101.  
  102.     XREF Do3DBox
  103.     XREF Do3DStringBox
  104.     XREF Do3DCycleBox
  105.     XREF DrawCheckMark
  106.     XREF HiliteGad
  107.  
  108. * Filereq.c
  109.  
  110.     XREF _DoFileRequest
  111.     XREF _DoSetBusyPointer
  112.  
  113. * Wildcard.c
  114.  
  115.     XREF _DoParsePattern
  116.     XREF _DoMatchPattern
  117.  
  118. * Dosstuff.c
  119.  
  120.     XREF _DoAssign
  121.     XREF _DoBaseName
  122.     XREF _DoCompareLock
  123.     XREF _DoPathName
  124.     XREF _DoSendPacket
  125.     XREF _DoTackOn
  126.     XREF _DoStampToStr
  127.     XREF _DoStrToStamp
  128.     XREF _DoAllocRemember
  129.     XREF _DoFreeRemember
  130.     XREF _DoFreeRemEntry
  131.     XREF _DoCompareDate
  132.     XREF _DoDoArrow
  133.     XREF _DoStrCombine
  134.     XREF _DoStrConcat
  135.     XREF _DoDecode_RLE
  136.  
  137. * Dosstuff2.c
  138.  
  139.     XREF _DoSearchPathList
  140.     XREF _DoCheckExist
  141.     XREF _DoRawkeyToStr
  142.     XREF _DoDoRMBGadget
  143.     XREF _DoAddGadgets
  144.     XREF _DoCheckNumGad
  145.     XREF _DoCheckHexGad
  146.     XREF _DoAtoh
  147.     XREF _DoDoSimpleRequest
  148.     XREF _DoDoCycleGadget
  149.     XREF _DoDrawRadioButton
  150.     XREF _DoGetButtonImage
  151.     XREF _DoGetCheckImage
  152.     XREF _DoUScoreText
  153.     XREF _DoDo3DFrame
  154.     XREF _DoDoGlassImage
  155.  
  156. * Dosstuff3.c
  157.  
  158.     XREF _DoReadConfig
  159.     XREF _DoSaveConfig
  160.     XREF _DoDefaultConfig
  161.     XREF _DoGetDevices
  162.     XREF _DoAssignGadget
  163.     XREF _DoAssignMenu
  164.     XREF _DoFreeConfig
  165.     XREF _DoCheckConfig
  166.     XREF _DoFindSystemFile
  167.  
  168. * Listview.c
  169.  
  170.     XREF _DoAddListView
  171.     XREF _DoListViewIDCMP
  172.     XREF _DoRemoveListView
  173.     XREF _DoRefreshListView
  174.     XREF _DoFixSliderBody
  175.     XREF _DoFixSliderPot
  176.     XREF _DoGetSliderPos
  177.     XREF _DoShowSlider
  178.  
  179. * Requesters.c
  180.  
  181.     XREF _R_OpenRequester
  182.     XREF _R_CloseRequester
  183.     XREF _R_AddRequesterObject
  184.     XREF _R_RefreshRequesterObject
  185.     XREF _R_ObjectText
  186.  
  187. * Language.c
  188.  
  189.     XREF _DoReadStringFile
  190.     XREF _DoFreeStringFile
  191.  
  192. * Borders.c
  193.  
  194.     XREF _DoAddGadgetBorders
  195.     XREF _DoCreateGadgetBorders
  196.     XREF _DoSelectGadget
  197.  
  198. * Menus.c
  199.  
  200.     XREF _DoFSSetMenuStrip
  201.  
  202. * Chip data
  203.  
  204.     XREF _pdb_cycletop
  205.     XREF _pdb_cyclebot
  206.     XREF _pdb_check
  207.  
  208. * Objects
  209.  
  210. ;    XREF _SysBase
  211. ;    XREF _DOpusBase
  212. ;    XREF _IntuitionBase
  213. ;    XREF _GfxBase
  214. ;    XREF _DOSBase
  215. ;    XREF _LayersBase
  216. ;    XREF ___MathIeeeSingBasBase
  217.  
  218. start:
  219.     moveq #0,d0
  220.     rts
  221.  
  222. romtag:
  223.     dc.w RTC_MATCHWORD
  224.     dc.l romtag
  225.     dc.l endcode
  226.     dc.b RTF_AUTOINIT
  227.     dc.b VERSION
  228.     dc.b NT_LIBRARY
  229.     dc.b 0
  230.     dc.l dopusname
  231.     dc.l idstring
  232.     dc.l init
  233.  
  234. VERSION  equ 22
  235. REVISION equ 8
  236.  
  237. dopusname:
  238.     DOPUSNAME
  239.  
  240. idstring:
  241.     dc.b 'dopus.library 22.8 (01 Apr 2000) made under GPL license by Jacek Rzeuski',13,10,0
  242.  
  243. dosname:
  244.     dc.b 'dos.library',0
  245. intuitionname:
  246.     dc.b 'intuition.library',0
  247. graphicsname:
  248.     dc.b 'graphics.library',0
  249. layersname:
  250.     dc.b 'layers.library',0
  251. mathieeesingbasname:
  252.     dc.b 'mathieeesingbas.library',0
  253.     ds.w 0
  254.  
  255. init:
  256.     dc.l DOpusBase_SIZEOF
  257.     dc.l functable
  258.     dc.l datatable
  259.     dc.l initroutine
  260.  
  261. functable:
  262.     dc.l Open
  263.     dc.l Close
  264.     dc.l Expunge
  265.     dc.l Null
  266.     dc.l _DoFileRequest
  267.     dc.l Do3DBox
  268.     dc.l Do3DStringBox
  269.     dc.l Do3DCycleBox
  270.     dc.l _DoDoArrow
  271.     dc.l LSprintf
  272.     dc.l LCreateExtIO
  273.     dc.l LCreatePort
  274.     dc.l LDeleteExtIO
  275.     dc.l LDeletePort
  276.     dc.l LToUpper
  277.     dc.l LToLower
  278.     dc.l LStrCat
  279.     dc.l LStrnCat
  280.     dc.l LStrCpy
  281.     dc.l LStrnCpy
  282.     dc.l LStrCmp
  283.     dc.l LStrnCmp
  284.     dc.l LStrCmpI
  285.     dc.l LStrnCmpI
  286.     dc.l _DoStrCombine
  287.     dc.l _DoStrConcat
  288.     dc.l LParsePattern
  289.     dc.l LMatchPattern
  290.     dc.l LParsePatternI
  291.     dc.l LMatchPatternI
  292.     dc.l BtoCStr
  293.     dc.l _DoAssign
  294.     dc.l _DoBaseName
  295.     dc.l _DoCompareLock
  296.     dc.l _DoPathName
  297.     dc.l _DoSendPacket
  298.     dc.l _DoTackOn
  299.     dc.l _DoStampToStr
  300.     dc.l _DoStrToStamp
  301.     dc.l _DoAddListView
  302.     dc.l _DoListViewIDCMP
  303.     dc.l _DoRefreshListView
  304.     dc.l _DoRemoveListView
  305.     dc.l DrawCheckMark
  306.     dc.l FixSliderBody
  307.     dc.l FixSliderPot
  308.     dc.l GetSliderPos
  309.     dc.l _DoAllocRemember
  310.     dc.l _DoFreeRemember
  311.     dc.l _DoSetBusyPointer
  312.     dc.l GetWBScreen
  313.     dc.l _DoSearchPathList
  314.     dc.l _DoCheckExist
  315.     dc.l _DoCompareDate
  316.     dc.l Seed
  317.     dc.l Random
  318.     dc.l StrToUpper
  319.     dc.l StrToLower
  320.     dc.l _DoRawkeyToStr
  321.     dc.l _DoDoRMBGadget
  322.     dc.l _DoAddGadgets
  323.     dc.l ActivateStrGad
  324.     dc.l RefreshStrGad
  325.     dc.l _DoCheckNumGad
  326.     dc.l _DoCheckHexGad
  327.     dc.l _DoAtoh
  328.     dc.l HiliteGad
  329.     dc.l _DoDoSimpleRequest
  330.     dc.l _DoReadConfig
  331.     dc.l _DoSaveConfig
  332.     dc.l _DoDefaultConfig
  333.     dc.l _DoGetDevices
  334.     dc.l _DoAssignGadget
  335.     dc.l _DoAssignMenu
  336.     dc.l _DoFindSystemFile
  337.     dc.l _DoDo3DFrame
  338.     dc.l _DoFreeConfig
  339.     dc.l _DoDoCycleGadget
  340.     dc.l _DoUScoreText
  341.     dc.l DisableGadget
  342.     dc.l EnableGadget
  343.     dc.l GhostGadget
  344.     dc.l _DoDrawRadioButton
  345.     dc.l _DoGetButtonImage
  346.     dc.l _DoShowSlider
  347.     dc.l _DoCheckConfig
  348.     dc.l _DoGetCheckImage
  349.     dc.l _R_OpenRequester
  350.     dc.l _R_CloseRequester
  351.     dc.l _R_AddRequesterObject
  352.     dc.l _R_RefreshRequesterObject
  353.     dc.l DoObjectText
  354.     dc.l _DoDoGlassImage
  355.     dc.l _DoDecode_RLE
  356.     dc.l _DoReadStringFile
  357.     dc.l _DoFreeStringFile
  358.     dc.l _DoFreeRemEntry
  359.     dc.l _DoAddGadgetBorders
  360.     dc.l _DoCreateGadgetBorders
  361.     dc.l _DoSelectGadget
  362.     dc.l _DoFSSetMenuStrip
  363.     dc.l -1
  364.  
  365. datatable:
  366.     INITBYTE LN_TYPE,NT_LIBRARY
  367.     INITLONG LN_NAME,dopusname
  368.     INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  369.     INITWORD LIB_VERSION,VERSION
  370.     INITWORD LIB_REVISION,REVISION
  371.     INITLONG LIB_IDSTRING,idstring
  372.     dc.l 0
  373.  
  374. initroutine:
  375.     move.l a5,-(sp)
  376.     move.l d0,a5
  377.     move.l a6,db_ExecBase(a5)
  378.     move.l a6,_SysBase
  379.     move.l a0,db_SegList(a5)
  380.  
  381.     move.l a5,_DOpusBase
  382.  
  383.     lea dosname(pc),a1
  384.     moveq.l #39,d0
  385.     move.l 4,a6
  386.     jsr _LVOOpenLibrary(a6)
  387.     move.l d0,db_DOSBase(a5)
  388.     move.l d0,_DOSBase
  389.  
  390.     lea intuitionname(pc),a1
  391.     moveq.l #39,d0
  392.     jsr _LVOOpenLibrary(a6)
  393.     move.l d0,db_IntuitionBase(a5)
  394.     move.l d0,_IntuitionBase
  395.  
  396.     lea graphicsname(pc),a1
  397.     moveq.l #39,d0
  398.     jsr _LVOOpenLibrary(a6)
  399.     move.l d0,db_GfxBase(a5)
  400.     move.l d0,_GfxBase
  401.  
  402.     lea layersname(pc),a1
  403.     moveq.l #39,d0
  404.     jsr _LVOOpenLibrary(a6)
  405.     move.l d0,db_LayersBase(a5)
  406.     move.l d0,_LayersBase
  407.  
  408.     lea mathieeesingbasname(pc),a1
  409.     moveq.l #0,d0
  410.     jsr _LVOOpenLibrary(a6)
  411. ;   move.l d0,db_MathIeeeSingBasBase(a5)
  412.     move.l d0,___MathIeeeSingBasBase
  413.  
  414. ;   jsr _init_dopus_library
  415.  
  416.     lea.l _pdb_cycletop,a0
  417.     move.l a0,pdb_cycletop(a5)
  418.  
  419.     lea.l _pdb_cyclebot,a0
  420.     move.l a0,pdb_cyclebot(a5)
  421.  
  422.     lea.l _pdb_check,a0
  423.     move.l a0,pdb_check(a5)
  424.  
  425.     move.l #0,pdb_Flags(a5)
  426.  
  427.     move.l 4,a6
  428.     move.l a5,d0
  429.     move.l (sp)+,a5
  430.     rts
  431.  
  432. Open:
  433.     addq.w #1,LIB_OPENCNT(a6)
  434.     bclr #LIBB_DELEXP,db_Flags(a6)
  435.     move.l a6,d0
  436.     rts
  437.  
  438. Close:
  439.     moveq.l #0,d0
  440.     subq.w #1,LIB_OPENCNT(a6)
  441.     bne.s   stillopen
  442.     btst #LIBB_DELEXP,db_Flags(a6)
  443.     beq.s   stillopen
  444.     bsr Expunge
  445. stillopen:
  446.     rts
  447.  
  448. Expunge:
  449.     movem.l d2/a5/a6,-(sp)
  450.     move.l a6,a5
  451.     tst.w   LIB_OPENCNT(a5)
  452.     beq.s   notopen
  453.     bset #LIBB_DELEXP,db_Flags(a5)
  454.     moveq.l #0,d0
  455.     bra expungeend
  456. notopen:
  457.     move.l db_SegList(a5),d2
  458.     move.l a5,a1
  459.     move.l 4,a6
  460.     jsr _LVORemove(a6)
  461.  
  462.     move.l db_DOSBase(a5),a1
  463.     jsr _LVOCloseLibrary(a6)
  464.     move.l db_IntuitionBase(a5),a1
  465.     jsr _LVOCloseLibrary(a6)
  466.     move.l db_GfxBase(a5),a1
  467.     jsr _LVOCloseLibrary(a6)
  468.     move.l db_LayersBase(a5),a1
  469.     jsr _LVOCloseLibrary(a6)
  470.  
  471.     moveq.l #0,d0
  472.     move.l a5,a1
  473.     move.w LIB_NEGSIZE(a5),d0
  474.     sub.l d0,a1
  475.     add.w LIB_POSSIZE(a5),d0
  476.     move.l 4,a6
  477.     jsr _LVOFreeMem(a6)
  478.     move.l d2,d0
  479.  
  480. expungeend:
  481.     movem.l (sp)+,d2/a5/a6
  482.     rts
  483.  
  484. Null:
  485.     moveq.l #0,d0
  486.     rts
  487.  
  488. LParsePattern:
  489.     moveq.l #0,d0
  490.     bra doparse
  491. LParsePatternI:
  492.     moveq.l #1,d0
  493. doparse:
  494.     movem.l a2-a6/d2-d7,-(sp)
  495.     move.l d0,-(sp)
  496.     move.l a1,-(sp)
  497.     move.l a0,-(sp)
  498.     jsr _DoParsePattern
  499.     add.l #12,sp
  500.     movem.l (sp)+,a2-a6/d2-d7
  501.     rts
  502.  
  503. LMatchPattern:
  504.     moveq.l #0,d0
  505.     bra domatch
  506. LMatchPatternI:
  507.     moveq.l #1,d0
  508. domatch:
  509.     movem.l a2-a6/d2-d7,-(sp)
  510.     move.l d0,-(sp)
  511.     move.l a1,-(sp)
  512.     move.l a0,-(sp)
  513.     jsr _DoMatchPattern
  514.     add.l #12,sp
  515.     movem.l (sp)+,a2-a6/d2-d7
  516.     rts
  517.  
  518. DoObjectText:
  519.     movem.l a2-a6/d2-d7,-(sp)
  520.     move.l d4,-(sp)
  521.     move.l a1,-(sp)
  522.     move.l d3,-(sp)
  523.     move.l d2,-(sp)
  524.     move.l d1,-(sp)
  525.     move.l d0,-(sp)
  526.     move.l a0,-(sp)
  527.     jsr _R_ObjectText
  528.     add.l #28,sp
  529.     movem.l (sp)+,a2-a6/d2-d7
  530.     rts
  531.  
  532. FixSliderBody:
  533.     movem.l a2-a6/d2-d7,-(sp)
  534.     move.l d2,-(sp)
  535.     move.l d1,-(sp)
  536.     move.l d0,-(sp)
  537.     move.l a1,-(sp)
  538.     move.l a0,-(sp)
  539.     jsr _DoFixSliderBody
  540.     add.l #20,sp
  541.     movem.l (sp)+,a2-a6/d2-d7
  542.     rts
  543.  
  544. FixSliderPot:
  545.     movem.l a2-a6/d2-d7,-(sp)
  546.     move.l d3,-(sp)
  547.     move.l d2,-(sp)
  548.     move.l d1,-(sp)
  549.     move.l d0,-(sp)
  550.     move.l a1,-(sp)
  551.     move.l a0,-(sp)
  552.     jsr _DoFixSliderPot
  553.     add.l #24,sp
  554.     movem.l (sp)+,a2-a6/d2-d7
  555.     rts
  556.  
  557. GetSliderPos:
  558.     movem.l a2-a6/d2-d7,-(sp)
  559.     move.l d1,-(sp)
  560.     move.l d0,-(sp)
  561.     move.l a0,-(sp)
  562.     jsr _DoGetSliderPos
  563.     add.l #12,sp
  564.     movem.l (sp)+,a2-a6/d2-d7
  565.     rts
  566.  
  567.     END
  568.